<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
{insert name="module_cssjs" css="core.css" js="jquery.min.js;jquery.area.js"}
</head>
{literal}
<style>
.selectInput {
    border: 1px solid #B9B9B9;
    padding: 5px 3px;
    width: 286px;
	vertical-align:middle;
}
.textarea {
	width: 100%;
}
.textarea1 {
	width: 500px;
	font-size: 12px;
}
</style>
<script type="text/javascript">
$(document).ready(function() {

$('[name="add-form"]').submit(function() {
	var title = $('input[name="title"]').val();
	if(!title) {
		alert('请输入页面名称'); return false;
	}
	var params = $('[name="add-form"]').serialize();
	$.post('/yunying/page/add.json', params, function(dt) {
		if(dt.status) {
			alert(dt.message);
		} else {
			alert('添加页面成功');
			window.location.href = '/yunying/page/';
		}
	}, 'json')
	return false;
});

$('[name="edit-form"]').submit(function() {
	var id = $('input[name="id"]').val();
	if(!id) {
		alert('未知页面'); return false;
	}
	var title = $('input[name="title"]').val();
	if(!title) {
		alert('请输入页面名称'); return false;
	}
	var params = $('[name="edit-form"]').serialize();
	$.post('/yunying/page/edit.json', params, function(dt) {
		if(dt.status) {
			alert(dt.message);
		} else {
			alert('编辑页面成功');
			window.location.href = '/yunying/page/';
		}
	}, 'json')
	return false;
});
})
</script>
{/literal}
<body>
<h3 class="label">
	{if $act == 'edit'}
	<strong class="on"><span>编辑页面</span></strong>
	<span class="refresh"><a href="javascript:history.go(-1);">返回</a></span>
	{else}
	<strong><span><a href="/yunying/page/">所有页面</a></span></strong>
	<strong class="on"><span>添加页面</span></strong>
	{/if}
	<span class="refresh"><a href="">刷新</a></span>
</h3>
<div class="table">
	<form {if $act == 'edit'}name="edit-form"{else}name="add-form"{/if} action="post">
	{if $act == 'edit'}<input name="id" type="hidden" value="{$info.id}" />{/if}
	<table class="TB-form">
		<tr>
			<td width="80">页面标题：</td>
			<td><input class="input" name="title" value="{$info.title}" /></td>
		</tr>
		<tr>
			<td width="80">所属分类：</td>
			<td>
				<select class="selectInput" name="cid">
				<option value="0">请选择分类</option>
				{html_options options=$category selected=$info.cid}
				</select>
			</td>
		</tr>
		<tr>
			<td width="80">文件名称：</td>
			<td><input class="input" name="filename" value="{$info.filename}" /></td>
		</tr>
		<tr>
			<td width="80">页面关键字：</td>
			<td><textarea class="textarea1" name="keywords">{$info.keywords}</textarea></td>
		</tr>
		<tr>
			<td width="80">页面描述：</td>
			<td><textarea class="textarea1" name="description">{$info.description}</textarea></td>
		</tr>
		<tr>
			<td width="80">页面内容：</td>
			<td>
				<textarea class="textarea" name="content">{$info.content}</textarea>
				{include file="module/module_editor.html" opts="" name="content"}
			</td>
		</tr>
	</table>
	<div class="btn-box">
		<span class="btn-indent"><input class="btn" type="submit" value="保&nbsp;&nbsp;存" /></span>
		<span class="btn-indent"><input class="btn" type="reset" value="重&nbsp;&nbsp;置" /></span>
	</div>
	</form>
</div>

</body>
</html>